﻿using FremtidensPlejehjem_Server.Messaging;
using ModelLayer;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FremtidensPlejehjem_Server
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Starting Server");
            Console.WriteLine("Initializing Messaging System");

            GeneralMessaging messaging = new GeneralMessaging();
            messaging.InitializeMessaging();

            Console.WriteLine("Server is now running. Type \"help\" to get a list of commands available.");

            string command = Console.ReadLine();

            CommandSwitch(command);
        }

        static void CommandSwitch(string command)
        {
            switch (command)
            {
                case "help":
                    Console.WriteLine("Commands:\n \"exit\" - Exits the program and shuts down the server\n");
                    break;
                case "exit":
                    Environment.Exit(0);
                    break;
                default:
                    Console.WriteLine("Command \"" + command + "\" was not found.");
                    break;
            }

            string newCommand = Console.ReadLine();

            CommandSwitch(newCommand);
        }
    }
}
